<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html">
<body>
	<ui:composition>

	<h:form>
		
		<h:dataTable id="table1" value="#{prList}" var="prequest">
			<h:column>
				<f:facet name="header">
					<h:outputText value="ID" />
				</f:facet>
				<h:outputText value="#{prequest.id}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Project" />
				</f:facet>
				<h:outputText value="#{prequest.project.code}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Description" />
				</f:facet>
				<h:outputText value="#{prequest.description}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Requistion Date" />
				</f:facet>
				<h:outputText value="#{prequest.requisitionDate}">
						<f:convertDateTime type="date" pattern="MM/dd/yyyy" />
				</h:outputText>
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Status" />
				</f:facet>
				<h:outputText value="#{prequest.status}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Approver" />
				</f:facet>
				<h:outputText value="#{prequest.approvedBy.displayName}" />
			</h:column>
			<h:column>
				<f:facet name="header">
					<h:outputText value="Action" />
				</f:facet>
				<h:commandButton styleClass="editbutton imgtxtbtn" type="submit" value="Edit" 
					action="#{purchaseRequisitionBean.view(prequest.id)}" />
				<h:outputLabel value=" " />
				<h:commandButton styleClass="deletebutton imgtxtbtn" 
					value="Del"	type="submit" rendered="#{createPurchaseRequisitionBean.renderDelete(prequest.id)}"
					action="#{createPurchaseRequisitionBean.delete(prequest.id)}" />
				
				<h:commandButton  action="#{purchaseRequisitionReportBean.execute(prequest.id)}" value="Preview" />
			</h:column>
		</h:dataTable>
	</h:form>
	
	</ui:composition>
</body>
</html>